package com.groupbuying.provider.service.impl;

import com.groupbuying.provider.dao.StoreRoleDao;
import com.groupbuying.provider.dto.forManage.StoreRoleDO;
import com.groupbuying.provider.service.StoreRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;

@Service
public class StoreRoleServiceImpl implements StoreRoleService {
    @Autowired
    StoreRoleDao roleMapper;


    /**
     * 获取用户的角色id
     *
     * @param userId
     * @return 角色id
     */
    @Override
    public List<BigInteger> roleIdsByUserId(String userId) {
        return roleMapper.roleIdsByAccountId(userId);
    }

    @Override
    public StoreRoleDO get(BigInteger id) {
        StoreRoleDO roleDO = roleMapper.get(id);
        return roleDO;
    }


    @Override
    public List<StoreRoleDO> listLike(Map<String, Object> map) {
        List<StoreRoleDO> roles = roleMapper.listLike(map);
        return roles;
    }

    @Override
    public int countLike(Map<String, Object> map) {
        return roleMapper.countLike(map);
    }

}
